<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/views/include/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ include file="/views/include/nocachehead.jsp"%>
<%@ include file="/views/include/statusbar.jsp"%>
<title>${spotInfo.name}</title>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/payattention.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/pagination.js"></script>

<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/comment.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.raty.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/stringutil.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/base.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/feed.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/shortMessage.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/notification.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/video.js"></script>
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/spot.css" />
</head>
<script type="text/javascript">
function ajaxVote(containerId,objId, star) {
	jQuery.ajax({
		url : "/skyline/spot/vote.html",
		type : "POST",
		data : "spotId=" + objId + "&star=" + star,
		dataType:"json",
		contentType : "application/x-www-form-urlencoded; charset=utf-8",
		success : function(msg) {
			var obj=msg;
			//alert(obj.SpotStar);
			$(containerId).raty.start(obj.SpotStar,'#'+containerId.id);
			if(obj.Raty_Tag)
			{
			alert("你已经评价过了");
			}
		}
	});
}
function AjaxstarInit(containerId,objId,startStar)
{
$(containerId).raty({
start: startStar,
click: function(score) {
			ajaxVote(containerId,objId,score);

		}	
});
}
$(document).ready(function(){
	
	if(${scope}==0){
		$('.countryTag').hide();
		$('.provinceTag').hide();
		$('.cityTag').hide();
		<c:set var="listUrl" value="${pageContext.request.contextPath}/spot/list.html"></c:set>
	//	alert("${listUrl}");
	}
	if(${scope}==1){
		$('.provinceTag').hide();
		$('.cityTag').hide();
		<c:set var="listUrl" value="${pageContext.request.contextPath}/spot/country/${spotList[0].siteId}/list.html"></c:set>
	//	alert("${listUrl}");
	}
	if(${scope}==2){
		$('.cityTag').hide();
		<c:set var="listUrl" value="${pageContext.request.contextPath}/spot/province/${spotList[0].siteId}/list.html"></c:set>
	//	alert("${listUrl}");
	}
	if(${scope}==3){
		<c:set var="listUrl" value="${pageContext.request.contextPath}/spot/city/${spotList[0].siteId}/list.html"></c:set>
	//	alert("${listUrl}");
	}
//	$('#myStar').starLevel();
//	AjaxstarInit(spotStar,${spotInfo.id},${spotInfo.star});
	//alert($('#content').html().length);
	//showDepart();
});
</script>


<body>
	<br>
	<br>
	<div class="positionView">
		<a>位置：</a> <a class="countryTag"
			href="${pageContext.request.contextPath}/spot/country/${spotList[0].siteId}/list.html">${spotList[0].country}</a>
		<em class="provinceTag">›</em> <a class="provinceTag"
			href="${pageContext.request.contextPath}/spot/province/${spotList[0].siteId}/list.html">${spotList[0].province}</a><em
			class="cityTag">›</em> <a class="cityTag"
			href="${pageContext.request.contextPath}/spot/city/${spotList[0].siteId}/list.html">${spotList[0].city}</a><em>
		</em><em> </em> <a href="${pageContext.request.contextPath}/spot/list.html">全部</a>
		<em> </em><em> </em><a
			href="${pageContext.request.contextPath}/spot/discovery.html">我要添加</a>
	</div>
	<div class="mainBox1"></div>
	<div class="mainBox2">
		<c:forEach items="${spotList}" var="spotInfo">
			<div class="spotView">
				<div class="portraitView">
					<a
						href="${pageContext.request.contextPath}/spot/views/${spotInfo.id}.html">
						<img title="${spotInfo.name}" width="100px" height="100px"
						src="${spotPortraitPath }/${spotInfo.portrait}" />
					</a>
				</div>
				<div class="spotInfoView">
					<p>${spotInfo.name }</p>
					<p>${spotInfo.country }${spotInfo.province }${spotInfo.city
						}${spotInfo.detailAddress }</p>
					<p>${spotInfo.introduction }</p>
				</div>
			</div>
			<br>
		</c:forEach>
		<div class="pageView">
			<c:if test="${scope == 0 }">
				<skyline:page
					url="${pageContext.request.contextPath}/spot/list.html"
					page="${requestScope.page}" maxSize="2" />
			</c:if>
			<c:if test="${scope == 1 }">
				<skyline:page
					url="${pageContext.request.contextPath}/spot/country/${spotList[0].siteId}/list.html"
					page="${requestScope.page}" maxSize="2" />
			</c:if>
			<c:if test="${scope == 2}">
				<skyline:page
					url="${pageContext.request.contextPath}/spot/province/${spotList[0].siteId}/list.html"
					page="${requestScope.page}" maxSize="2" />
			</c:if>
			<c:if test="${scope == 3}">
				<skyline:page
					url="${pageContext.request.contextPath}/spot/province/${spotList[0].siteId}/list.html"
					page="${requestScope.page}" maxSize="2" />
			</c:if>
		</div>
	</div>
</body>
</html>